import { EntityDto } from "./entity";
import type { IAudited } from "./interfaces/audited";
import type { ICreationAudited } from "./interfaces/creation-audited";
import type { IModificationAudited } from "./interfaces/modification-audited";
import { PagedResultRequestDto } from "./paged-result-request";

/**
 * 数据字典数据传输对象
 */
export class DataDictionaryDto extends EntityDto {
    /**
     * 编码
     */
    public code!: string;

    /**
     * 名称
     */
    public displayName!: string;

    /**
     * 父级编码
     */
    public parentCode?: string;

    /**
     * 值
     */
    public value?: string;

    /**
     * 排序
     */
    public sort!: number;
}

export class DataDictionaryResultDto extends DataDictionaryDto implements IAudited {
    public creatorUserId?: number;

    public creationTime!: Date;

    public lastModifierUserId?: number;

    public lastModificationTime?: Date;

    public children?: Array<DataDictionaryResultDto>;
}

export class DataDictionaryResultRequestDto extends PagedResultRequestDto {
    public code!: string;
}